import React from 'react';
import { connect } from 'dva'
import styles from './work.less';
import workImg from '@/assets/image/dtimage/work.png'
import downIcon from '../../assets/image/xl.svg'
import { setTime } from '../../utils/timeProcess.js'
class Work extends React.Component {
  render() {
    const { avgWorkHour, avgOnDutyTime, avgOffDutyTime } = this.props
    return (
      <div className={styles.bg}>
        <img className={styles.downIcon} src={downIcon} alt='' />
        <div className={styles.timeBox}>
          <div className={styles.title}>你平均每天辛勤工作<span className={styles.textColor}>{Number(avgWorkHour || '').toFixed(1)}</span>小时</div>
          <div className={styles.time}>
            {setTime(avgOnDutyTime || '') + '-' + setTime(avgOffDutyTime || '')}
          </div>
          <div className={styles.text1}>早上你沐浴阳光走进数澜的大门</div>
          <div className={styles.text2}>晚上你踏着月色而归</div>
        </div>
        <img className={styles.img} src={workImg} alt=""></img>
        <div className={styles.text3}>坚持了这么久，给自己鼓个掌～</div>
      </div>
    )
  }
}

export default connect(({ index }) => index.workHour)(Work)